package com.kdzy.lshy.socity_server.controller;

import com.kdzy.lshy.socity_server.service.OfficerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;


/**
 * @author rtt
 */
@RestController
@RequestMapping("/officer")
@Api(value = "办公人员登录")
@CrossOrigin("*")
public class OfficerController {

    private static final Logger logger = LoggerFactory.getLogger(OfficerController.class);

    @Autowired
    private OfficerService officerService;

    @RequestMapping(value = "/officerlogin", method = RequestMethod.POST)
    @ApiOperation(value = "登录方法")
    public Object login(
            @ApiParam(name = "param", value = "参数详情", required = true)
                    String param, HttpServletRequest request) {
        logger.info("进入《办公人员 - 登录》login()方法：入参：param = " + param);
        return officerService.officeLogin(param, request);
    }

    //注销
    @RequestMapping(value = "/editout", method = RequestMethod.POST)
    public Object edit(String param,HttpServletRequest request) {
        logger.info("进入《办公人员 - 注销》edit()方法：入参：param = " + param);
      return  officerService.edit(param, request);
    };

    //工作端办事员个人信息
    @RequestMapping(value = "/officerinfor", method = RequestMethod.POST)
    public Object officerInformation(String param) {
        logger.info("进入《办公人员 - 个人信息》officerInformation()方法：入参：param = " + param);
        return officerService.officerInformation(param);
    };
}
